#ifndef __BSP_KEY_H__
#define __BSP_KEY_H__

#include "gpio.h"

#define key_state_0        0
#define key_state_1        1  
#define key_state_2        2 

#define KEY1_PRESSED (Gpio_GetInputIO(GpioPortB, GpioPin1) == FALSE)
#define KEY2_PRESSED (Gpio_GetInputIO(GpioPortA, GpioPin4) == FALSE) 

#define KEY1_VALUE (0x0a)
#define KEY2_VALUE (0x0b) 

#define KEY_TOTALS   2

typedef struct stc_gain
{
	uint8_t value; // [0 ~ 28]
//	int active_cnt; // 按键激活用于触发仪表盘增益显示
    boolean_t active_flg;
}stc_gain_t;

extern stc_gain_t gain;

typedef enum
{
	KEY_NONE,
	KEY_UP,
	KEY_DOWN,
}e_key;

void BSP_Key_Init(void);

uint8_t Key_scan(void);


#endif


